//
//  JigSawStripButtonLayer.m
//  JigSawKiosk
//
//  Created by shaun on 10-11-03.
//  Copyright 2010 FruitonLabs. All rights reserved.
//

#import "JigSawStripButtonLayer.h"


@implementation JigSawStripButtonLayer

- (id)initWithObjects:(CGFloat)radius string:(NSString *)stringVal {
    self = [super init];
    if (self) {
        [self setupLayer:radius string:stringVal] ;
    }
    return self;
}


- (void) setupLayer:(CGFloat)radius string:(NSString *)stringVal {
	//CGFloat radius = 25.0;
	[self setMasksToBounds:YES];
	[self setBackgroundColor:CGColorCreateGenericGray(0.9, 1.0)] ;
	[self setCornerRadius:radius];
	[self setBounds:CGRectMake(0.0f, 0.0f, radius *2, radius *2)];
	
	
	
	 // record count Down
	CGFloat fontSize = [self bounds].size.height*0.5 ;
	
	CATextLayer *numberDisplay = [CATextLayer layer] ;
	
	
	numberDisplay.string = stringVal ;
	numberDisplay.font = @"Arial";
	numberDisplay.fontSize = fontSize ;
	numberDisplay.foregroundColor =  CGColorCreateGenericGray(0.6, 1.0) ; 
	numberDisplay.frame = [self bounds] ;
	numberDisplay.position = CGPointMake([self bounds].size.width*0.65, [self bounds].size.height*0.25) ;
	[self addSublayer:numberDisplay] ;
	
}


@end
